package com.zhongan.cloud.config.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

	@Value("${config.name}")
	private String name = "World";
	
	@Value("${config.name}")
	private final String name2 = "World";
	
	@RequestMapping("/")
	public String home() {
		return "Hello " + name;
	}
	
	@RequestMapping("/refresh")
	public String refresh() throws IllegalArgumentException, IllegalAccessException {
		PropertyUtils.refresh();
		return "refresh ok";
	}
	
}
